<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="timer">
        

    </div>
    <script>
        var timer = document.getElementById("timer");

        var count = 10;
            var interval = setInterval(function(){
            timer.innerHTML = "倒计时：" + count;
            count--;
            if(count < 0){
                clearInterval(interval);
                timer.innerHTML = "时间到！";
            }
            }, 1000);

    </script>
</body>
</html>